package com.sfh.cpc.com.entity;

import android.os.Build;
import android.support.annotation.RequiresApi;
import android.text.TextUtils;

import com.sfh.cpc.com.BaseAppContent;
import com.sfh.lib.AppCacheManager;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Base64;
import java.util.Date;

/**
 * 功能描述: 留言
 *
 * @author SunFeihu 孙飞虎
 * @date 2018/8/9
 */
public class EMessage {

    long messageId;
    //创建时间
    String msgCreateTime;
    //内容
    String msgContent;
    //话题ID
    long noteId;
    //创建者ID
    long userId;
    EUser user;

    public long getMessageId() {
        return messageId;
    }

    public String getMsgCreateTime() {
        return msgCreateTime;
    }

    public String getMsgContent() {

        return BaseAppContent.decode(msgContent);
    }

    public long getNoteId() {
        return noteId;
    }

    public long getUserId() {
        return userId;
    }

    public EUser getUser() {
        return user;
    }
    public static EMessage createTemp( String msgContent){
        EMessage msg = new EMessage();
        msg.msgContent = msgContent;
        msg.msgCreateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
        msg.user  = AppCacheManager.getCache(BaseAppContent.USER, EUser.class);
        return msg;
    }

}
